package com.car.controller;

import com.car.entity.Car;
import com.car.service.ICarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
public class CarController {

    @Autowired
    @Qualifier("carService")
    public ICarService iCarService;

    @GetMapping( value = "/findCarAll")
    public String findCarAll(Model model, HttpSession session){
        List<Car> cars = iCarService.findAll();
        model.addAttribute("car",cars);
        return "/add_User.jsp";
    }

}
